package demo01;

class Employee {
    String name;

    public void work() {
        System.out.println("我要工作，工作使我快乐");
    }
}

class Teacher extends Employee {
      public void PrintName(){
          System.out.println("我叫"+name);
      }
}

public class ExtendDemo01 {
    public static void main(String[] args) {
        Teacher T=new Teacher();
        T.name="张三";
        T.PrintName();
        T.work();
    }

}
